package com.lv.dhart.api;


import static com.lv.dhart.constant.ApiPathConstant.API_AS_BASE_INFO_LIST;
import static com.lv.dhart.constant.ApiPathConstant.API_AS_BASE_RISK_LIST;
import static com.lv.dhart.constant.ApiPathConstant.API_AS_COST;
import static com.lv.dhart.constant.ApiPathConstant.API_AS_COST_LIST;
import static com.lv.dhart.constant.ApiPathConstant.API_AS_HOLDERS_HOLD_COUNT;
import static com.lv.dhart.constant.ApiPathConstant.API_AS_JJ_HOLD_STOCK_LIST;
import static com.lv.dhart.constant.ApiPathConstant.API_USER_LOGIN;
import static com.lv.dhart.constant.ApiPathConstant.API_USER_LOGIN_CODE;

import com.lv.dhart.api.bean.BannerBean;
import com.lv.dhart.api.bean.CommetRealBean;
import com.lv.dhart.api.bean.ConnectServiceBean;
import com.lv.dhart.api.bean.CreateOrderBean;
import com.lv.dhart.api.bean.FriendsBean;
import com.lv.dhart.api.bean.FriendsListBean;
import com.lv.dhart.api.bean.HeChengDatailBean;
import com.lv.dhart.api.bean.HeChengListBean;
import com.lv.dhart.api.bean.HomeHDListBean;
import com.lv.dhart.api.bean.HomeRXListBean;
import com.lv.dhart.api.bean.HomeZTBean;
import com.lv.dhart.api.bean.ImageCodeBean;
import com.lv.dhart.api.bean.KeyStatusBean;
import com.lv.dhart.api.bean.LogOutBean;
import com.lv.dhart.api.bean.LoginSendCodeBean;
import com.lv.dhart.api.bean.LoginUserBean;
import com.lv.dhart.api.bean.MineRealBean;
import com.lv.dhart.api.bean.NFTDetailBean;
import com.lv.dhart.api.bean.NoTiceListBean;
import com.lv.dhart.api.bean.OrderBean;
import com.lv.dhart.api.bean.RegSendCodeBean;
import com.lv.dhart.api.bean.RegUserBean;
import com.lv.dhart.api.bean.SynthesisdataBean;
import com.lv.dhart.api.bean.UpdataPassWordBean;
import com.lv.dhart.api.bean.UpdataUserImageBean;
import com.lv.dhart.api.bean.UpdataUserNameBean;
import com.lv.dhart.api.bean.UserAgreementBean;
import com.lv.dhart.api.bean.UserInfoBean;
import com.lv.dhart.api.bean.UserInvitationBean;
import com.lv.dhart.api.bean.UserMarketBean;
import com.lv.dhart.api.bean.ZeroRoundPurchaseBean;
import com.lv.dhart.api.bean.ZhuanSongBean;
import com.lv.dhart.api.bean.ZhuanSongListBean;
import com.lv.dhart.api.bean.ZhuanSongTimeBean;
import com.lv.dhart.api.bean.ZhuanzhengBean;
import com.lv.dhart.beans.JJHoldStockListBeans;
import com.lv.dhart.beans.JJHoldeBeans;
import com.lv.dhart.beans.RiskBeans;
import com.lv.dhart.beans.as4kdots.CostChangeBeans;
import com.lv.dhart.beans.as4kdots.OrganizationHoldStockCodeBean;
import com.lv.dhart.beans.cost.AddResultBean;
import com.lv.dhart.beans.cost.DeleteBean;
import com.lv.dhart.beans.login.LoginBean;

import java.util.HashMap;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface Apiserivce {

    /**
     * 发送短信验证码
     *
     * @param phone 手机号
     * @return
     */
    @GET(API_USER_LOGIN_CODE)
    Observable<LoginSendCodeBean> loginSmsCode(@Path("phone") String phone);


    /**
     * 通过短信验证码和手机号的登录
     *
     * @param map
     * @return
     */
    @POST(API_USER_LOGIN)
    Observable<LoginBean> login(@Body HashMap<String, String> map);


    /**
     * 获取用户成本列表
     *
     * @param offset
     * @param limit
     * @return
     */
    @GET(API_AS_COST_LIST)
    Observable<CostChangeBeans> getStockCostList(@Header("Authorization") String token, @Path("offset") int offset, @Path("limit") int limit);


    @POST(API_AS_COST)
    Observable<AddResultBean> addCostStockCode(@Header("Authorization") String token, @Body HashMap<String, String> params);

    @DELETE(API_AS_COST+"/{id}")
    Observable<DeleteBean> deleteById(@Header("Authorization") String token, @Path("id") int id);

    @PUT(API_AS_COST)
    Observable<AddResultBean> addCostStock(@Header("Authorization") String token, @Body HashMap<String, String> params);


    @GET(API_AS_BASE_INFO_LIST)
    Observable<OrganizationHoldStockCodeBean> getStockBaseInfoList(@Path("offset") int offset, @Path("limit") int limit);
    @GET(API_AS_BASE_RISK_LIST)
    Observable<RiskBeans> getBaseRiskList(@Path("offset") int offset, @Path("limit") int limit, @Path("stock") String stock);


    @GET(API_AS_HOLDERS_HOLD_COUNT)
    Observable<JJHoldeBeans> getJJHoldCountList(@Path("offset") int phone, @Path("limit") int limit);

    @POST(API_AS_JJ_HOLD_STOCK_LIST)
    Observable<JJHoldStockListBeans> getJJHoldStockList(@Path("offset") int phone, @Path("limit") int limit, @Body HashMap<String, String> params);

    //发送图形验证码
    @GET(API_AS_COST)
    Observable<ImageCodeBean> SendImageCode();

    //登录发送验证码
    @POST("openapi/code/login")
    Observable<LoginSendCodeBean> LoginSendCode(@Body HashMap<String, String> map);


    //注册发送验证码
    @POST("/openapi/code/register")
    Observable<RegSendCodeBean> regSendCode(@Body HashMap<String, String> map);

    //注册
    @POST("/openapi/user/register")
    Observable<RegUserBean> regUser(@Body HashMap<String, Object> map);

    //登录
    @POST("/app/login_h5")
    Observable<LoginUserBean> LoginUser(@Body HashMap<String, Object> map);

    //找回发送验证码
    @POST("/openapi/code/back")
    Observable<RegSendCodeBean> BackSendCode(@Body HashMap<String, String> map);

    //找回密码
    @POST("/openapi/user/back")
    Observable<RegUserBean> BackpassWord(@Body HashMap<String, Object> map);

    //banner
    @GET("/public/banner/list")
    Observable<BannerBean> BannerList();

    //首页热销专区
    @GET("public/nft/list2?pageNum=1&pageSize=100")
    Observable<HomeRXListBean> HomeRXList(@Header("Referer") String Referer);

    //主题藏品
    @GET("public/nft_category/list")
    Observable<HomeZTBean> HomeZTList();

    //活动专区
    @GET("/public/nft/synthesis/list?pageNum=1&pageSize=15")
    Observable<HomeHDListBean> HomeHDList();

    @GET("public/announcement/list")
    Observable<NoTiceListBean> NoTiceList();

    //首页热销专区
    @GET("public/nft/list2")
    Observable<HomeRXListBean> HomeRXList2(@Header("Referer") String Referer, @Query("cid") int id);

    //首页热销专区
    @GET("api/user/info")
    Observable<UserInfoBean> UserInfo(@Header("token") String token);

    //获取合成详情
    @GET("/api/synthesis/{synthesis_id}/detail")
    Observable<SynthesisdataBean> getSynthwsis(@Path("synthesis_id") int synthesis_id, @Header("token") String token);

    //查询实名认证信息
    @GET("/api/user/kyc")
    Observable<MineRealBean> getreal(@Header("token") String token);

    //查询实名认证信息
    @POST("/api/user/kyc")
    Observable<CommetRealBean> getCommetRealinfo(@Header("token") String token, @Body HashMap<String, Object> map);

    //设置用户头像
    @Multipart
    @POST("/api/user/avatar")
    Observable<UpdataUserImageBean> updata_myheadpic(@Header("token") String token, @Part MultipartBody.Part file);

    //设置昵称
    @POST("/api/user/nickname")
    Observable<UpdataUserNameBean> UpdataUserName(@Header("token") String token, @Body HashMap<String, Object> map);

    //设置性别
    @POST("/api/user/gender")
    Observable<UpdataUserNameBean> UpdataUserAge(@Header("token") String token, @Body HashMap<String, Object> map);

    //设置生日
    @POST("/api/user/birthday")
    Observable<UpdataUserNameBean> UpdataUserbirthday(@Header("token") String token, @Body HashMap<String, Object> map);

    //联系客服
    @GET("/public/article/customer_service")
    Observable<ConnectServiceBean> ConnectService();

    //用户协议
    @GET("/public/article/user_agreement")
    Observable<UserAgreementBean> UserAgreement();

    //隐私政策
    @GET("/public/article/privacy_policy")
    Observable<UserAgreementBean> privacy_policy();

    //修改密码
    @POST("/api/edit/password")
    Observable<UpdataPassWordBean> Updatapassword(@Header("token") String token, @Body HashMap<String, Object> map);

    //用户藏品列表
    @GET("api/nft_order/list")
    Observable<UserMarketBean> UserMarket(@Header("token") String token, @QueryMap HashMap<String, Object> map);

    //用户藏品详情
    @GET("/public/nft/{id}/info")
    Observable<RequestBody> UsermarketDetail(@Path("id") int id);

    //NFT藏品詳情
    @GET("/public/nft/{id}/info")
    Observable<NFTDetailBean> NFTDetail(@Path("id") int id);

    //我的订单
    @GET("/api/nft_order/list2")
    Observable<OrderBean> getOderBean(@Header("token") String token, @Query("status") int status);

    //退出登录
    @POST("/app/logout_h5")
    Observable<LogOutBean> Logout(@Header("token") String token);

    //消息中心
    @GET("public/article/list?page_num=1&page_size=15")
    Observable<NoTiceListBean> getMessage();

    //我的邀请
    @GET("/api/activityInvite/myActivityInvite")
    Observable<FriendsBean> getFriends(@Header("token") String token);

    //我的邀请列表
    @GET("/api/activityInvite/myActivityInviteList")
    Observable<FriendsListBean> getFriendslist(@Header("token") String token, @Query("pageNum") int pagenum, @Query("pageSize") int pageSize, @Query("activityInviteId") int id);

    //我的排名
    @GET("/api/activityInvite/activityInviteRanking/{activityInviteId}")
    Observable<UserInvitationBean> getpaiming(@Header("token") String token, @Path("activityInviteId") int id);

    //）转赠记录查询
    @GET("api/nft_transfer/record?page_Num=1&page_Size=15")
    Observable<ZhuanSongBean> getZhuanSong(@Header("token") String token, @Query("type") int type);

    //z转增列表
    @GET("api/nft_transfer/list?page_Num=1&page_Size=15")
    Observable<ZhuanSongListBean> getZhuanSongList(@Header("token") String token, @Query("nftCode") String type);

    //获取用户藏品可以转赠时间
    @GET("/api/nft_transfer/timeout")
    Observable<ZhuanSongTimeBean> getZhuanSongTime(@Header("token") String token, @Query("nftCode") String type);

    //零圆够
    @POST("/api/nft_order/create_app_zero")
    Observable<ZeroRoundPurchaseBean> PostZeroRoundPurchaseBean(@Header("token") String token, @Body HashMap<String, Object> map);

    //付款订单的预支付会话标识
    @POST("/api/nft_order/create_order")
    Observable<CreateOrderBean> PostCreateOrder(@Header("token") String token, @Body HashMap<String, Object> map);

    //合成记录查询列表
    @GET("api/synthesis/record?page_num=1&page_size=15")
    Observable<HeChengListBean> hechenglist(@Header("token") String token);

    //合成材料详情查询
    @GET("/api/synthesis/record/{record_id}/detail")
    Observable<HeChengDatailBean> gethechengdatail(@Path("record_id") int record_id, @Header("token") String token);

    //校验双方是否实名
    @POST("/api/nft_transfer/check_kyc")
    Observable<KeyStatusBean> KeyStatusBean(@Header("token") String token, @Body HashMap<String, Object> map);

    //发送转增验证码
    @POST("/api/nft_transfer/send_code")
    Observable<LoginSendCodeBean> ZhuanzengSendCode(@Header("token") String token, @Body HashMap<String, String> map);

    //转增
    @POST("/api/nft_transfer/deal")
    Observable<ZhuanzhengBean> Zhuanzeng(@Header("token") String token, @Body HashMap<String, String> map);
}
